package com.mao.adapterpattern;

import com.mao.adapterpattern.klass.Adapter;
import com.mao.adapterpattern.object.NeedAdaptee;
import com.mao.adapterpattern.object.NeedAdapterChild;
import com.mao.adapterpattern.object.ObjectAdapter;

public class Main {

    public static void main(String[] args) {
//        classAdapterTest();//this is the special request

//        objectAdapterTest();//this is Object Adapter the special request

        /**
         * this is Object Adapter the special request
         * this is the child class special request
         */
        objectAdapterTestChild();

    }

    private static void objectAdapterTestChild() {
        NeedAdapterChild needAdapterChild = new NeedAdapterChild();
        ObjectAdapter adapter = new ObjectAdapter(needAdapterChild);
        adapter.request();
    }

    private static void objectAdapterTest() {
        NeedAdaptee needAdaptee = new NeedAdaptee();
        ObjectAdapter adapter = new ObjectAdapter(needAdaptee);
        adapter.request();
    }

    private static void classAdapterTest() {
        Adapter adapter = new Adapter();
        adapter.request();
    }


}
